class Person(object):
    def __init__(self, id, name):
        self.set_id(id)
        self.set_name(name)

    def set_id(self, val):
        if not isinstance(val, int):
            raise Exception('id must be integer')
        self._id = val

    def get_id(self):
        return self._id

    def set_name(self, val):
        if not isinstance(val, str):
            raise Exception('name must be string')
        self._name = val

    def get_name(self):
        return self._name

    def show(self):
        print('姓名：' + self.get_name(), '编号：' + str(self.get_id()), sep=', ', end=', ')


class Student(Person):
    def __init__(self, id, name, class_id, score):
        super(Student, self).__init__(id, name)
        self.set_class_id(class_id)
        self.set_score(score)

    def set_class_id(self, val):
        if not isinstance(val, int):
            raise Exception('class_id must be integer')
        self._class_id = val

    def get_class_id(self):
        return self._class_id

    def set_score(self, val):
        if not isinstance(val, int):
            raise Exception('score must be integer')
        self._score = val

    def get_score(self):
        return self._score

    def show(self):
        super(Student, self).show()
        print('班级：' + str(self.get_class_id()), '成绩：' + str(self.get_score()), sep=', ', end='\n')


class Teacher(Person):
    def __init__(self, id, name, title, department):
        super(Teacher, self).__init__(id, name)
        self.set_title(title)
        self.set_department(department)

    def set_title(self, val):
        if not isinstance(val, str):
            raise Exception('title must be string')
        self._title = val

    def get_title(self):
        return self._title

    def set_department(self, val):
        if not isinstance(val, str):
            raise Exception('department must be string')
        self._department = val

    def get_department(self):
        return self._department

    def show(self):
        super(Teacher, self).show()
        print('职称：' + self.get_title(), '部门：' + self.get_department(), sep=', ', end='\n')


slist = []
tlist = []
option = 0
while option != 3:
    option = int(input("请选择您要进行的操作： 1 - 添加学生, 2 - 添加教师, 3 - 退出："))
    if option == 1:
        student = Student(
            int(input("请输入编号（int）：")),
            input("请输入姓名（str）："),
            int(input("请输入学生班级号（int）：")),
            int(input("请输入学生成绩（int）："))
        )
        slist.append(student)
    if option == 2:
        teacher = Teacher(
            int(input("请输入编号（int）：")),
            input("请输入姓名（str）："),
            input("请输入教师职称（str）："),
            input("请输入教师部门（str）：")
        )
        tlist.append(teacher)

if not len(tlist) == 0:
    print("教师信息：")
    for t in tlist:
        t.show()
if not len(slist) == 0:
    print("学生信息：")
    for s in slist:
        s.show()

